﻿using System;
using System.Threading;
using System.Threading.Tasks;

namespace BarManagement.DomainService.Base
{
    public interface IUnitOfWork : IDisposable       
    {
        IRepository<TEntity> Repository<TEntity>() where TEntity : class;
        void Dispose(bool disposing);
        void BeginTransaction();
        void Rollback();
        Task<int> SaveChangesAsync();
        Task<int> SaveChangesAsync(CancellationToken cancellationToken);
        Task<int> CommitAsync();
    }
}
